package com.authine.cloudpivot.ext.dto.transfer;

import com.authine.mvp.app.launcher.domain.SelectorFormat;
import com.authine.mvp.app.permission.dto.clientobject.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName OrderCustomerDto
 * @Description: 转采订单商品表
 * @Author cjj
 * @Date 2021/6/18
 * @Version V1.0
 **/
@Data
@Schema(description = "TransferOrderGoodsDto")
@ApiModel("转采订单商品表")
public class TransferOrderGoodsDto extends BaseDto {
    @Schema(description = "转采订单商品ID")
    private String id;
    @Schema(description = "转采订单商品ID集合")
    private List<String> ids;
    @Schema(description = "状态")
//    private OrderGoodsStatusEnum transferOrderGoodsStatus;
    private String transfer_order_goods_status;
    @Schema(description = "云平台订单商品ID")
    private String cloud_order_goods_id;
    @Schema(description = "云平台订单商品ID")
    private String cloud_order_id;
    @Schema(description = "转采订单ID")
    private String transfer_order_id;
    @Schema(description = "供应商id")
    private SelectorFormat vendor_id;
    @Schema(description = "分类")
    private String category;
    @Schema(description = "品牌")
    private String brand;
    @Schema(description = "商品名称")
    private String name;
    @Schema(description = "型号")
    private String model;
    @Schema(description = "规格")
    private String spec;
    @Schema(description = "SKU")
    private String sku;
    @Schema(description = "备注")
    private String memo;
    @Schema(description = "单位")
    private String unit;
    @Schema(description = "货期(工作日)")
    private Integer delivery;
    @Schema(description = "数量")
    private BigDecimal num;
    @Schema(description = "含税商品单价")
    private BigDecimal price;
    @Schema(description = "未税商品单价")
    private BigDecimal pre_price;
    @Schema(description = "运费")
    private BigDecimal freight;
    @Schema(description = "税率")
    private BigDecimal tax_rate;
    @Schema(description = "含税商品合计")
    private BigDecimal total;
    @Schema(description = "未税商品合计")
    private BigDecimal pre_total;
    @Schema(description = "含税商品运费共计")
    private BigDecimal amount;
    @Schema(description = "未税商品运费共计")
    private BigDecimal pre_amount;
    @Schema(description = "收货时间")
    private String delivery_time;
    @Schema(description = "采购人")
    private String purchasing_agent_id;
    @Schema(description = "采购员姓名")
    private String purchase_agent_name;
    @Schema(description = "是否再次采购")
    private String not_purchase;
    @Schema(description = "已采购数量")
    private BigDecimal quantity_purchased;
    @Schema(description = "操作人")
    private SelectorFormat operator;
    @Schema(description = "采购批次")
    private Integer purchase_batch;
    @Schema(description = "原平台订单销售数量")
    private BigDecimal sale_num;
    @Schema(description = "已申请开票金额")
    private BigDecimal apply_amount;
    @Schema(description = "已申请开票数量")
    private BigDecimal apply_num;
    @Schema(description = "金税编码")
    private String golden_tax;
    @Schema(description = "供应商名称")
    private String vendor_name;
    @Schema(description = "报价标记信息")
    private String remark_message;
    @Schema(description = "询价单ID")
    private String inquiry_id;
    @Schema(description = "标记已采购原因")
    private String reason;
    @Schema(description = "是否分配采购员")
    private Boolean is_assign_buyer;
    @Schema(description = "下单日期", pattern = "yyyy-MM-dd HH:mm:ss")
    private List<String> createdTimes;
    @Schema(description = "pageIndex")
    private Integer pageIndex;
    @Schema(description = "pageSize")
    private Integer pageSize;
    @Schema(description = "下单组织（转采客户订单表）")
    private String organization_name;
    @Schema(description = "平台名称（转采客户订单表）")
    private String platform_name;

    public static Map<String, Object> voToEntity(TransferOrderGoodsDto dto) {
        Map<String, Object> result = new HashMap<>();
        result.put("transfer_order_goods_status", dto.getTransfer_order_goods_status());
        result.put("cloud_order_goods_id", dto.getCloud_order_goods_id());
        result.put("transfer_order_id", dto.getTransfer_order_id());
        result.put("vendor_id", dto.getVendor_id());
        result.put("category", dto.getCategory());
        result.put("brand", dto.getBrand());
        result.put("name", dto.getName());
        result.put("model", dto.getModel());
        result.put("spec", dto.getSpec());
        result.put("sku", dto.getSku());
        result.put("memo", dto.getMemo());
        result.put("unit", dto.getUnit());
        result.put("delivery", dto.getDelivery());
        result.put("num", dto.getNum());
        result.put("price", dto.getPrice());
        result.put("pre_price", dto.getPre_price());
        result.put("freight", dto.getFreight());
        result.put("tax_rate", dto.getTax_rate());
        result.put("total", dto.getTotal());
        result.put("pre_total", dto.getPre_total());
        result.put("amount", dto.getAmount());
        result.put("delivery_time", dto.getDelivery_time());
        result.put("purchasing_agent_id", dto.getPurchasing_agent_id());
        result.put("not_purchase", dto.getNot_purchase());
        result.put("quantity_purchased", dto.getQuantity_purchased());
        result.put("operator", dto.getOperator());
        result.put("purchase_batch", dto.getPurchase_batch());
        result.put("sale_num", dto.getSale_num());
        result.put("apply_amount", dto.getApply_amount());
        result.put("apply_num", dto.getApply_num());
        result.put("golden_tax", dto.getGolden_tax());
        result.put("vendor_name", dto.getVendor_name());
        result.put("remark_message", dto.getRemark_message());
        result.put("inquiry_id", dto.getInquiry_id());
        result.put("reason", dto.getReason());
        return result;
    }
}
